package fictional.Common;

import java.util.ArrayList;
import java.util.List;

/**
 * The interface for the business logic layer 
 */
public interface IBL {
	/**
	 * Gets a list of all available Gender items 
	 * @param response The response
	 * @return The list
	 */
	List<GenderItem> getAllGenders(Response response);
	/**
	 * Gets a list of all available places
	 * @param response The response
	 * @return The list
	 */
	List<PlaceItem> getAllPlaces(Response response);
	/**
	 * Gets a list of all available species
	 * @param response The response
	 * @return The list
	 */
	List<SpeciesItem> getAllSpecies(Response response);
	/**
	 * Gets a ShortCharacterItem by supplying a desired string
	 * @param name The desired (partial) name
	 * @param response The response
	 * @return ArrayList of character names matching the search pattern
	 */
	List<ShortCharacterItem> getShortCharacterByName(String name,Response response);
	/**
	 * Gets a CharacterItem by supplying its id
	 * @param character The character
	 * @param response The response
	 * @return The full character data
	 */
	CharacterItem getCharacter(ShortCharacterItem character,Response response);
	/**
	 * Gets a ShortCharacterItem by supplying its id 
	 * @param char_id The id
	 * @param response The response
	 * @return The short character data
	 */
	ShortCharacterItem getShortCharacterById(int char_id, Response response);
	/**
	 * Gets the default character associated with this user
	 * @param user The user
	 * @param response The response
	 * @return The full default character data
	 */
	CharacterItem getDefaultCharacter(Response response);
	/**
	 * Edits the supplied character's information
	 * @param character The character
	 * @param name The character's name
	 * @param gender The gender
	 * @param species The species
	 * @param organizations The organizations
	 * @param birthplace The birthplace
	 * @param occupations The occupations
	 * @param superPowers The superpowers
	 */
	void editCharacterInformation(CharacterItem character, String name, GenderItem gender, SpeciesItem species, 
			String organizations, PlaceItem birthplace, String occupations, String superPowers, Response response);
	/**
	 * Inserts a new user and creates a character associated with this user
	 * @param user The user 
	 * @param name The character's name
	 * @param gender The gender
	 * @param species The species
	 * @param organizations The organizations
	 * @param birthplace The birthplace
	 * @param occupations The occupations
	 * @param superPowers The superpowers
	 */
	boolean insertNewUser(User user, String name, GenderItem gender, SpeciesItem species, String organizations, 
			PlaceItem birthplace, String occupations, String superPowers, Response response);
	/**
	 * Updates the supplied charaters' status 
	 * @param character The character
	 * @param status The new status 
	 * @param response The response
	 */
	void editCharacterStatus(CharacterItem character, String status, Response response);
	/**
	 * Deletes a friend from the friends list
	 * @param characacter The character
	 * @param friend The friend to remove
	 * @param response The response
	 * @return True on success
	 */
	boolean deleteFriend(CharacterItem characacter, ShortCharacterItem friend, Response response);
	/**
	 * Validates the user and his password. If credentials are valid, updates the user id.
	 * @param user The user and password
	 * @param response The response
	 * @return True on successful login
	 */
	boolean login(User user, Response response);
	/**
	 * Gets the wall object related with the supplied character
	 * @param character The character
	 * @param response The response
	 * @return The wall
	 */
	Wall getWall(CharacterItem character, Response response);
	/**
	 * Posts to a wall
	 * @param poster The poster character
	 * @param postedTo The posted character
	 * @param text The post's text
	 * @param date The date
	 * @param wall The wall
	 * @param response The response
	 */
	void postToWall(CharacterItem poster, ShortCharacterItem postedTo, String text, Wall wall, Response response);
	/**
	 * Deletes a wall post from a wall
	 * @param wall The wall
	 * @param wallPost The wall post
	 * @param response The response
	 */
	void deleteWallPost(Wall wall, WallItem wallPost, Response response);
	/**
	 * Gets the messages object related with the supplied character 
	 * @param character The character
	 * @param response The response
	 * @return The messages
 	 */
	Messages getMessages(CharacterItem character, boolean incomingMessages, Response response);
	/**
	 * Sends a message between two characters
	 * @param sender The sender character
	 * @param sentTo The receiver character
	 * @param message The message's text
	 * @param messages The messages
	 * @param response The response
	 */
	void sendMessage(CharacterItem sender, ShortCharacterItem sentTo, String message, Response response);
	/**
	 * Deletes a message from the messages
	 * @param messages The messages 
	 * @param message The message to be deleted
	 * @param response The response
	 */
	void deleteMessage(Messages messages, MessageItem message, Response response);
	/**
	 * Gets the friend requests of the supplied character
	 * @param character The character
	 * @param response The response
	 * @return The friend requests
	 */
	FriendRequests getFriendRequests(CharacterItem character, boolean toCharacter, Response response);
	/**
	 * Creates a new friend request 
	 * @param from The requester
	 * @param to The accepter
	 * @param response The response
	 */
	void createNewFriendRequest(CharacterItem from, ShortCharacterItem to, Response response);
	/**
	 * Accepts a friend request
	 * @param requests The requests 
	 * @param request The request
	 * @param response The response
	 */
	void acceptFriendRequest(FriendRequests requests, FriendRequestItem request, Response response);
	/**
	 * Declines a friend request 
	 * @param requests The requests
	 * @param request The request
	 * @param response The response
	 */
	void declineFriendRequest(FriendRequests requests, FriendRequestItem request, Response response);
	/**
	 * Inserts a poke into the system
	 * @param poke The poke
	 * @param response The response
	 */
	void insertPoke(PokeItem poke,Response response);
	/**
	 * Gets the supplied character's pokes
	 * @param character The character
	 * @param response The response
	 * @return The pokes object
	 */
	Pokes getPokes(CharacterItem character, Response response);
	/**
	 * Gets a list of suggested friends for the supplied character 
	 * @param character The character 
	 * @param response The response
	 * @return A list of suggested friends
	 */
	List<ShortCharacterItem> getSuggestedCharacters(ShortCharacterItem character, Response response);
	/**
	 * Inserts an image into the supplied character
	 * @param character The character
	 * @param imageLink The image link
	 * @param response The response
	 */
	void insertCharacterImage(CharacterItem character, String imageLink, Response response);
	/**
	 * Sets the character's profile image
	 * @param img The image
	 * @param character The character
	 * @param response The response
	 */
	void setProfileImage(ImageItem img, CharacterItem character, Response response);
	/**
	 * Deletes the image from the supplied character
	 * @param character The character
	 * @param img The image
	 * @param response The response
	 */
	void deleteCharacterImage(CharacterItem character, ImageItem img,Response response);			
}
